package com.cloud.DrugManagement.mapper;

import java.util.Date;
import com.cloud.DrugManagement.enums.OrderState;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cloud.DrugManagement.pojo.OrderDetails;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * @author zhozixiong
 * @date 2023/02/11
 */
@Mapper
@Repository
public interface OrderDetailsMapper extends BaseMapper<OrderDetails> {

    @Override
    int insert(@Param("order") OrderDetails order);

    int updateStateByOid(@Param("state") OrderState state, @Param("oid") Long oid);

    int updateCreationTimeStateByOid(@Param("creationTime") Date creationTime, @Param("state") OrderState state, @Param("oid") Long oid);

    int delByOid(@Param("oid") Long oid);

    OrderDetails searchAllByOid(@Param("oid") Long oid);

    Page<OrderDetails> searchAllOrOid(Page page, @Param("oid") Long oid);
}
